/******************************************************************************/
/* packet_def.h                                                               */
/******************************************************************************/

#ifndef __PACKET_DEF_H
#define __PACKET_DEF_H


/*********************** Macros & Constants for PACKET ************************/
#define PACKET_CELL_EN_FLG       (0xAAAA)
#define PACK_SEND_EVENT          (0x00000001)

#define PACK_END_LEN             (10)
#define PACK_ARRAY_MAX_LEN       (120)
#define PACK_BUFF_LEN            (300)

/*********************** Prototypes & struct for PACKET ***********************/
typedef enum
{
    ePACK_VALUE = 0,          // cell is single value
    ePACK_ARRAY               // cell is array elements
} __TYPE_CELL_PACK;           // Type cell


typedef struct
DATA_PACK
{
    DATA_PACK() : pBuff(0), len(0) {}

    uint8_t * pBuff;
    sint32_t  len;
} __DATA_PACK;


#pragma pack(1)
typedef struct
ACTION_SETT_PACKET
{
    ACTION_SETT_PACKET() : isCellEn(0), addr(0), cellType(0), typeLen(0) {}

    uint16_t isCellEn;
    uint8_t  strName[18];
    uint32_t addr;
    uint16_t cellType;
    uint16_t typeLen;
} __CELL_SETT_PACKET;         // Cell settings for packet
#pragma pack()


#endif